<?php

/**
 * EmsHasAccess form.
 *
 * @package    ems1
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class EmsHasAccessForm extends BaseEmsHasAccessForm
{
    public function configure()
    {
        unset($this['created_at'], $this['updated_at']);

        $this->widgetSchema['user_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('sfGuardUser'), 'add_empty' => false));
        $this->widgetSchema['portal_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('EmsPortal'), 'add_empty' => false));

        $this->validatorSchema['user_id'] = new sfValidatorDoctrineChoice(
                array('model' => $this->getRelatedModelName('sfGuardUser'),
                    'required' => true
                ),
                array(
                    'required' => 'Campo obligatorio',
                    'invalid'  => 'Valor invalido',
                ));

        $this->validatorSchema['portal_id'] = new sfValidatorDoctrineChoice(
                array('model' => $this->getRelatedModelName('EmsPortal'),
                    'required' => true
                ),
                array(
                    'required' => 'Campo obligatorio',
                    'invalid'  => 'Valor invalido',
                ));
    }
}
